package com.danielepelagatti.flickrmanager.commands.auth
{
	import com.adobe.cairngorm.control.CairngormEventDispatcher;
	import com.adobe.webapis.flickr.events.FlickrResultEvent;
	import com.danielepelagatti.flickrmanager.commands.FlickrCommand;
	import com.danielepelagatti.flickrmanager.commands.IFlickrCommand;
	import com.danielepelagatti.flickrmanager.events.AuthEvent;
	import com.danielepelagatti.flickrmanager.model.Flickr;
	import com.danielepelagatti.flickrmanager.model.States;
	
	import mx.core.Application;

	public class GetFrob extends FlickrCommand implements IFlickrCommand
	{
		/**
		 * 
		 * @param event
		 * 
		 */		
		public function error(event:FlickrResultEvent):Boolean
		{
			return false;
		}
		/**
		 * 
		 * @param event
		 * 
		 */		
		public function success(event:FlickrResultEvent):void
		{
			Flickr.frob						= event.data.frob;
			States.getInstance().state 		= States.GET_TOKEN_SCREEN;
		}
		/**
		 * 
		 * @return 
		 * 
		 */		
		public function getAPICall():Function
		{
			return flickr.auth.getFrob;
		}
		
	}
}